<!--
PivotalMySQLWeb

Copyright (c) 2017-Present Pivotal Software, Inc. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml">
<head>
    <title>Pivotal MySQL*Web - Endpoints</title>

    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />

    <link rel="stylesheet" th:href="@{'themes/' + ${session.themeMain}}" media="screen" />
    <link rel="stylesheet" th:href="@{'themes/' + ${session.themeMin}}" />

    <!-- Latest compiled and minified JavaScript -->
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>

    <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>

    <script type="text/javascript" src="https://cdn.datatables.net/r/bs-3.3.5/jqc-1.11.3,dt-1.10.8/datatables.min.js"></script>

    <link href="https://cdn.datatables.net/plug-ins/1.10.7/integration/bootstrap/3/dataTables.bootstrap.css" rel="stylesheet" />
    <script src="https://cdn.datatables.net/1.10.7/js/jquery.dataTables.min.js"></script>
    <script src="https://cdn.datatables.net/plug-ins/1.10.7/integration/bootstrap/3/dataTables.bootstrap.js"></script>

    <script th:src="@{js/functions.js}" type="text/javascript"></script>

    <script type="text/javascript" charset="utf-8">
        $(document).ready(function() {
            $('#datatable-mysql').DataTable();
        } );
    </script>

    <script type="text/javascript">
        // <![CDATA[

        // js form validation stuff
        var confirmMsg  = 'Do you really want to ';
        // ]]>
    </script>

    <style>
        .navbar-brand
        {
            position: absolute;
            width: 100%;
            left: 0;
            margin: auto;
            margin-left: 48%;
        }
    </style>
</head>
<body>

<div class="navbar navbar-default">
    <div class="container">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <div class="navbar-brand navbar-left">
                <a href="#">
                    <img src="images/PVLG-PivotalMYSQLWeb-SM.png"
                         th:src="@{images/PVLG-PivotalMYSQLWeb-SM.png}"
                         alt="Brand" />
                </a>
            </div>
        </div>
        <div class="navbar-collapse collapse">
            <ul class="nav navbar-nav navbar-right nav-pills">
                <li>
                    <a th:href="@{/home}">
                        <img src="images/b_home.png"
                             th:src="@{images/b_home.png}"
                             alt="Home"
                             border="0"/>
                        Home
                    </a>
                </li>
                <li>
                    <a th:href="@{/exit}">
                        <img src="images/s_loggoff.png"
                             th:src="@{images/s_loggoff.png}"
                             alt="Logout"
                             border="0"/>
                        Logout
                    </a>
                </li>
                <li class="dropdown">
                    <a href="#" data-toggle="dropdown" class="dropdown-toggle">Menu <b class="caret"></b></a>
                    <ul class="dropdown-menu">
                        <li>
                            <a th:href="@{/prefs}">
                                <img src="images/b_props.png"
                                     th:src="@{images/b_props.png}"
                                     alt="Preferences"
                                     border="0"/>
                                Preferences
                            </a>
                        </li>
                        <li>
                            <a href="http://docs.pivotal.io/p-mysql/1-7/" target="_new">
                                <img src="images/b_docs.png"
                                     th:src="@{images/b_docs.png}"
                                     alt="p-mysql docs"
                                     border="0"/>
                                p-mysql Doc
                            </a>
                        </li>
                        <li class="divider"></li>
                        <li>
                            <a th:href="@{/refresh}">
                                <img src="images/eye.png"
                                     th:src="@{images/eye.png}"
                                     alt="Refresh"
                                     border="0"/>
                                Refresh
                            </a>
                        </li>
                    </ul>
                </li>
                <li class="dropdown">
                    <a href="#" data-toggle="dropdown" class="dropdown-toggle">Schema Objects <b class="caret"></b></a>
                    <ul class="dropdown-menu">
                        <li>
                            <a th:href="@{/tables}">
                                <img src="images/s_tbl.png"
                                     th:src="@{images/s_tbl.png}"
                                     alt="Tables"
                                     border="0"/>
                                Tables[<span th:text="${session.schemaMap.Table}" />]
                            </a>
                        </li>
                        <li>
                            <a th:href="@{/views}">
                                <img src="images/b_views.png"
                                     th:src="@{images/b_views.png}"
                                     alt="Views"
                                     border="0"/>
                                Views[<span th:text="${session.schemaMap.View}" />]
                            </a>
                        </li>
                        <li>
                            <a th:href="@{/indexes}">
                                <img src="images/b_index.png"
                                     th:src="@{images/b_index.png}"
                                     alt="Indexes"
                                     border="0"/>
                                Indexes[<span th:text="${session.schemaMap.Index}" />]
                            </a>
                        </li>
                        <li>
                            <a th:href="@{/constraints}">
                                <img src="images/constraints.png"
                                     th:src="@{images/constraints.png}"
                                     alt="Constraints"
                                     border="0"/>
                                Constraints[<span th:text="${session.schemaMap.Constraint}" />]
                            </a>
                        </li>
                        <li class="divider"></li>
                        <li>
                            <a th:href="@{/query}">
                                <img src="images/b_sql.png"
                                     th:src="@{images/b_sql.png}"
                                     alt="SQL Worksheet"
                                     border="0"/>
                                SQL Worksheet
                            </a>
                        </li>
                    </ul>
                </li>
                <li class="dropdown">
                    <a href="#" data-toggle="dropdown" class="dropdown-toggle">Themes <b class="caret"></b></a>
                    <ul class="dropdown-menu">
                        <li><a th:href="@{/selecttheme(theme='default')}">Default</a></li>
                        <li><a th:href="@{/selecttheme(theme='sandstone')}">Sandstone</a></li>
                        <li><a th:href="@{/selecttheme(theme='cyborg')}">Cyborg</a></li>
                        <li><a th:href="@{/selecttheme(theme='slate')}">Slate</a></li>
                        <li><a th:href="@{/selecttheme(theme='spacelab')}">Spacelab</a></li>
                    </ul>
                </li>
                <li class="dropdown" th:if="${session.servicesListSize > 0}">
                    <a href="#" data-toggle="dropdown" class="dropdown-toggle">Instances <b class="caret"></b></a>
                    <ul class="dropdown-menu" style="min-width: 300px;">
                        <div th:each="service : ${session.servicesList}">
                            <li><a th:href="@{/switchinstance(instanceType=${service.type},instanceName=${service.name})}">Switch to <span th:text="${service.name}" /></a></li>
                        </div>
                    </ul>
                </li>
                <li>
                    <a href="#">
                        <img src="images/b_usrlist.png"
                             th:src="@{images/b_usrlist.png}"
                             alt="Users"
                             border="0"/>
                        [User: <span th:text="${session.user} ? ${session.user} : 'Not Logged In'">Not Logged In</span>]
                    </a>
                </li>
            </ul>
        </div>

    </div>
</div>
<!-- NAVBAR CODE END -->

<div class="bs-example">
    <div class="page-header">
        <h1>Pivotal MySQL*Web - <small>Endpoints</small></h1>
    </div>
</div>

<ul class="nav nav-tabs">
    <li>
        <a th:href="@{/home}">
            <img src="images/b_home.png"
                 th:src="@{images/b_home.png}"
                 alt="Home"
                 border="0"/>
            Home
        </a>
    </li>
    <li>
        <a th:href="@{/tables}">
            <img src="images/s_tbl.png"
                 th:src="@{images/s_tbl.png}"
                 alt="Tables"
                 border="0"/>
            Tables[<span th:text="${session.schemaMap.Table}" />]
        </a>
    </li>
    <li>
        <a th:href="@{/views}">
            <img src="images/b_views.png"
                 th:src="@{images/b_views.png}"
                 alt="Views"
                 border="0"/>
            Views[<span th:text="${session.schemaMap.View}" />]
        </a>
    </li>
    <li>
        <a th:href="@{/indexes}">
            <img src="images/b_index.png"
                 th:src="@{images/b_index.png}"
                 alt="Views"
                 border="0"/>
            Indexes[<span th:text="${session.schemaMap.Index}" />]
        </a>
    </li>
    <li>
        <a th:href="@{/constraints}">
            <img src="images/constraints.png"
                 th:src="@{images/constraints.png}"
                 alt="Constraints"
                 border="0"/>
            Constraints[<span th:text="${session.schemaMap.Constraint}" />]
        </a>
    </li>
    <li>
        <a th:href="@{/query}">
            <img src="images/b_sql.png"
                 th:src="@{images/b_sql.png}"
                 alt="SQL Worksheet"
                 border="0"/>
            SQL Worksheet
        </a>
    </li>
    <li>
        <a th:href="@{/viewconmap}">
            <img src="images/Connection.gif"
                 th:src="@{images/Connection.gif}"
                 alt="View Connections"
                 border="0"/>
            Connections
        </a>
    </li>
    <li class="active">
        <a th:href="@{/endpoints}">
            <img src="images/s_notice.png"
                 th:src="@{images/s_notice.png}"
                 alt="Endpoints"
                 border="0"/>
            Endpoints
        </a>
    </li>
    <li>
        <a th:href="@{/userinfo}">
            <img src="images/s_info.png"
                 th:src="@{images/s_info.png}"
                 alt="Information"
                 border="0"/>
            Information
        </a>
    </li>
    <li>
        <a th:href="@{/variables}">
            <img src="images/s_vars.png"
                 th:src="@{images/s_vars.png}"
                 alt="Database Variables"
                 border="0"/>
            Variables
        </a>
    </li>
</ul>

<p />

<div class="container">
    <!--Row with two columns divided in 1:2 ratio-->
    <div class="row">
        <div class="col-xs-8">
            <div>
                <p>
                    VCAP_SERVICES, VCAP_APPLICATION will only be valid within Cloud Foundry
                </p>
                <small>by <cite>Pas Apicella</cite></small>
                <p />
                <div class="panel-group" id="accordion">
                    <div class="panel panel-default">
                        <div class="panel-heading">
                            <h4 class="panel-title">
                                <a data-toggle="collapse" data-parent="#accordion" href="#collapseOne">JVM PROPERTIES</a>
                            </h4>
                        </div>
                        <div id="collapseOne" class="panel-collapse collapse">
                            <div class="panel-body">
                                <table class="table table-hover table-bordered table-striped table-condensed">
                                    <div th:each="item : ${propertyMap}">
                                        <tr>
                                            <td><span th:text="${item.key}" /></td>
                                            <td><span th:text="${item.value}" /></td>
                                        </tr>
                                    </div>
                                </table>
                            </div>
                        </div>
                    </div>
                    <div class="panel panel-default">
                        <div class="panel-heading">
                            <h4 class="panel-title">
                                <a data-toggle="collapse" data-parent="#accordion" href="#collapseTwo">VCAP_SERVICES</a>
                            </h4>
                        </div>
                        <div id="collapseTwo" class="panel-collapse collapse">
                            <div class="panel-body">
                                <table class="table table-hover table-bordered table-striped table-condensed">
                                    <div th:each="item : ${vcapServices}">
                                        <tr>
                                            <td><span th:text="${item.key}" /></td>
                                            <td><span th:text="${item.value}" /></td>
                                        </tr>
                                    </div>
                                </table>
                            </div>
                        </div>
                    </div>
                    <div class="panel panel-default">
                        <div class="panel-heading">
                            <h4 class="panel-title">
                                <a data-toggle="collapse" data-parent="#accordion" href="#collapseThree">VCAP_APPLICATION</a>
                            </h4>
                        </div>
                        <div id="collapseThree" class="panel-collapse collapse">
                            <div class="panel-body">
                                <table class="table table-hover table-bordered table-striped table-condensed">
                                    <div th:each="item : ${vcapApplication}">
                                        <tr>
                                            <td><span th:text="${item.key}" /></td>
                                            <td><span th:text="${item.value}" /></td>
                                        </tr>
                                    </div>
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <p><strong>Note:</strong> Click on the linked heading text to expand or collapse</p>
        </div>
        <div class="col-xs-4">
            <div>
                <p>
                    Endpoints for Spring Boot ACTUATOR as per below
                </p>
                <small>by <cite>Pas Apicella</cite></small>
            </div>

            <div>
                <h4> Spring Boot ACTUATOR </h4>

                <ul>
                    <li><a href="/actuator/env" target="_new">Environment for shell/JVM</a> </li>
                    <li><a href="/actuator/beans" target="_new">Spring Context Beans</a> </li>
                    <li><a href="/actuator/autoconfig" target="_new">auto-configuration</a> </li>
                    <li><a href="/actuator/mappings" target="_new">URI request mappings</a> </li>
                    <li><a href="/actuator/httptrace" target="_new">Displays trace information</a> </li>
                    <li><a href="/actuator/threaddump" target="_new">Performs Thread Dump</a> </li>
                    <li><a href="/actuator/metrics" target="_new">Display Metrics</a> </li>
                </ul>

            </div>
        </div>
    </div>
</div>

<div class="clearfix">
</div>

<div th:include="footer :: copy"></div>

</body>
</html>